package com.bailian.system.service.impl;

import java.util.List;
import com.bailian.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.bailian.system.mapper.BlBannerMapper;
import com.bailian.system.domain.BlBanner;
import com.bailian.system.service.IBlBannerService;

/**
 * BannerService业务层处理
 * 
 * @author ruoyi
 * @date 2025-08-04
 */
@Service
public class BlBannerServiceImpl implements IBlBannerService 
{
    @Autowired
    private BlBannerMapper blBannerMapper;

    /**
     * 查询Banner
     * 
     * @param bannerId Banner主键
     * @return Banner
     */
    @Override
    public BlBanner selectBlBannerByBannerId(Long bannerId)
    {
        return blBannerMapper.selectBlBannerByBannerId(bannerId);
    }

    /**
     * 查询Banner列表
     * 
     * @param blBanner Banner
     * @return Banner集合
     */
    @Override
    public List<BlBanner> selectBlBannerList(BlBanner blBanner)
    {
        return blBannerMapper.selectBlBannerList(blBanner);
    }

    /**
     * 查询所有Banner页面类型列表（去重）
     * 
     * @return Banner页面类型集合
     */
    @Override
    public List<String> selectAllBannerPages()
    {
        return blBannerMapper.selectAllBannerPages();
    }

    /**
     * 根据页面类型查询Banner列表
     * 
     * @param bannerPage Banner页面类型
     * @return Banner集合
     */
    @Override
    public List<BlBanner> selectBlBannerByBannerPage(String bannerPage)
    {
        return blBannerMapper.selectBlBannerByBannerPage(bannerPage);
    }

    /**
     * 新增Banner
     * 
     * @param blBanner Banner
     * @return 结果
     */
    @Override
    public int insertBlBanner(BlBanner blBanner)
    {
        blBanner.setCreateTime(DateUtils.getNowDate());
        return blBannerMapper.insertBlBanner(blBanner);
    }

    /**
     * 修改Banner
     * 
     * @param blBanner Banner
     * @return 结果
     */
    @Override
    public int updateBlBanner(BlBanner blBanner)
    {
        blBanner.setUpdateTime(DateUtils.getNowDate());
        return blBannerMapper.updateBlBanner(blBanner);
    }

    /**
     * 批量删除Banner
     * 
     * @param bannerIds 需要删除的Banner主键
     * @return 结果
     */
    @Override
    public int deleteBlBannerByBannerIds(Long[] bannerIds)
    {
        return blBannerMapper.deleteBlBannerByBannerIds(bannerIds);
    }

    /**
     * 删除Banner信息
     * 
     * @param bannerId Banner主键
     * @return 结果
     */
    @Override
    public int deleteBlBannerByBannerId(Long bannerId)
    {
        return blBannerMapper.deleteBlBannerByBannerId(bannerId);
    }
}
